package com.scorpio.agentuser.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.scorpio.agentuser.domain.AgentPayUserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.Date;

@Mapper
public interface AgentPayUserMapper extends BaseMapper<AgentPayUserEntity> {

    /**
     * 查询统计
     *
     * @param agentId    代理商Id
     * @param date       查询时间
     * @param recLevel   查询类型 1直推 2间推
     * @param dateLength 时间长度 QueryDataEnum
     * @return
     */
    Float countRegTotali(
            @Param("agentId") Long agentId
            , @Param("date") Date date
            , @Param("recLevel") Integer recLevel
            , @Param("dateLength") Integer dateLength
    );

    int updateIncomeGrant(@Param("id")Long id, @Param("grant")String grant);

}
